if SERVER then
	registerDisplay("log", function (plys, what)
		//The logs
		for i, ply in pairs(plys) do
			if i == "server" then
				displayLogWhat(what)
			else
				umsg.Start("moocow_logOnClient", plys)
					umsg.String(what)
				umsg.End()
			end
		end
		filex.Append("moocow/log.txt", "\n" .. what)
	end)
end

local function logOnClient(data)
	displayLogWhat(data:ReadString())
end
usermessage.Hook("moocow_logOnClient", logOnClient)

function displayLogWhat(what)
	if not file.Exists("moocow/log.txt") then
		file.Write("moocow/log.txt", "")
	end
	local loadData = file.Read("moocow/log.txt")
	file.Write("moocow/log.txt", loadData .. "\n" .. what)
end